package chain.bimpl;

public class Client {

    public AbstractHandler getAbstractHandler() {
        AbstractHandler aHandler = new Employee();
        AbstractHandler bHandler = new Leader();
        AbstractHandler cHandler = new Boss();
        aHandler.setNextHandler(bHandler);
        bHandler.setNextHandler(cHandler);
        return aHandler;
    }

    public static void main(String[] args) {
        Client client = new Client();
        //最小范围
        System.out.println(client.getAbstractHandler().doChain(32));
//中间范围
        System.out.println(client.getAbstractHandler().doChain(320));
//不在范围
        System.out.println(client.getAbstractHandler().doChain(900));
//最大范围
        System.out.println(client.getAbstractHandler().doChain(3200));

    }
}
